﻿#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using BreakOutBattles.IO;
#endregion

namespace BreakOutBattles.Game.Items
{
    /// <summary>
    /// A helper class used to create different game items.
    /// </summary>
    public static class GameItemFactory
    {
        private static IOManager ioManager = IOManager.Instance;

        /// <summary>
        /// Attempts to create a game item with a specified ID and an initial position.
        /// </summary>
        /// <param name="ownerScreen">The Screen that will handle the created game item</param>
        /// <param name="levelItemID">An ID that defines the game item to be created.</param>
        /// <param name="itemPosition">The initial of the game item to be created.</param>
        public static GameItem CreateGameItem(GameScreen ownerScreen, string levelItemID, Vector2 itemPosition)
        {
            switch (levelItemID)
            {
                case " ":
                    //Brick emptyBrick = new Brick(Vector2.Zero, ioManager.LoadTextureFromId("b"));
                    //emptyBrick.Active = false;
                    return null;
                
                case "1":
                    return new HardBrick(itemPosition, ioManager.LoadTextureFromId(levelItemID));

                case "2":
                    return new SteelBrick(itemPosition, ioManager.LoadTextureFromId(levelItemID));

                case "3":
                    return new DancingBrick(itemPosition, ioManager.LoadTextureFromId(levelItemID));

                case "4":
                    return new DancingBrick(itemPosition, ioManager.LoadTextureFromId(levelItemID), AnimationDirection.VERTICAL);

                case "5":
                    return new FadeBrick(itemPosition, ioManager.LoadTextureFromId(levelItemID));

                case "6":
                    return new SmokeBrick(ownerScreen, itemPosition, ioManager.LoadTextureFromId(levelItemID));
                default:
                    return new Brick(itemPosition, ioManager.LoadTextureFromId(levelItemID));
            }
        }
    }
}
